package com.ld.campus_help.controller;

import com.ld.campus_help.entity.Lost;
import com.ld.campus_help.entity.School;
import com.ld.campus_help.service.SchoolService;
import com.ld.campus_help.util.Result;
import com.ld.campus_help.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/school")
public class SchoolController {
    @Autowired
    private SchoolService schoolService;

    @PostMapping("/list")
    public Result getSchoolList(){
        List<School> result = schoolService.getList();
        if(result != null) return ResultUtil.success(result);
        return ResultUtil.failure();
    }
}
